package com.neu.admin;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ibatis.annotations.Param;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.neu.common.RequiresPermissionsDesc;
import com.neu.common.validator.Order;
import com.neu.common.validator.Sort;
import com.neu.doc.AdminCollectController_list;
import com.neu.doc.ResponseOK;
import com.neu.domain.ShoppingCollect;
import com.neu.domain.ShoppingCollectExample;
import com.neu.service.ShoppingCollectService;
import com.neu.util.ResponseUtil;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

import java.util.List;

@CrossOrigin
@RestController
@Validated
@RequestMapping("/admin/collect")
public class AdminCollectController {
    private final Log logger = LogFactory.getLog(AdminCollectController.class);
	
    @Autowired
	private ShoppingCollectService shoppingCollectService;
	


    @RequiresPermissions("admin:collect:list")
    @RequiresPermissionsDesc(menu = {"用户管理", "用户收藏"}, button = "查询")
    @GetMapping("/list")
    public Object list( @RequestParam(defaultValue = "1") Integer page,
            @RequestParam(defaultValue = "10") Integer limit,
            @Sort @RequestParam(defaultValue = "add_time") String sort,
            @Order @RequestParam(defaultValue = "desc") String order){
    	    List<ShoppingCollect> list=shoppingCollectService.querySelective(page, limit, sort, order);
    			
    	    return ResponseUtil.okList(list);
    	
    }
 
}
